const getDateInfo = (date: Date) => {
  const year = date.getFullYear();
  const month = (date.getMonth() + 1).toString().padStart(2, '0');
  const day = date.getDate().toString().padStart(2, '0');
  const hour = date.getHours();
  const minute = date.getMinutes();
  const second = date.getSeconds();
  return {
    year,
    month,
    day,
    hour,
    minute,
    second,
  };
};
export const getFormatDate = (date?: Date) => {
  if (!date) {
    date = new Date();
  }
  const { year, month, day } = getDateInfo(date);

  return `${year}-${month}-${day}`;
};
